<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableUserItem class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableUserItem object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableUserItemMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableUserItem $TableUserItem the actual TableUserItem data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdControl
	 * property-read QLabel $UserIdLabel
	 * property QIntegerTextBox $PresentUserIdControl
	 * property-read QLabel $PresentUserIdLabel
	 * property QIntegerTextBox $ItemIdControl
	 * property-read QLabel $ItemIdLabel
	 * property QIntegerTextBox $PriceControl
	 * property-read QLabel $PriceLabel
	 * property QIntegerTextBox $TaxWithinControl
	 * property-read QLabel $TaxWithinLabel
	 * property QIntegerTextBox $CountControl
	 * property-read QLabel $CountLabel
	 * property QIntegerTextBox $PresentStatusControl
	 * property-read QLabel $PresentStatusLabel
	 * property QIntegerTextBox $LicenseDayControl
	 * property-read QLabel $LicenseDayLabel
	 * property QTextBox $SubscriptionControl
	 * property-read QLabel $SubscriptionLabel
	 * property QTextBox $ImageControl
	 * property-read QLabel $ImageLabel
	 * property QTextBox $SimageControl
	 * property-read QLabel $SimageLabel
	 * property QDateTimePicker $GetDateControl
	 * property-read QLabel $GetDateLabel
	 * property QDateTimePicker $SuspendDateControl
	 * property-read QLabel $SuspendDateLabel
	 * property QDateTimePicker $PresentDateControl
	 * property-read QLabel $PresentDateLabel
	 * property QDateTimePicker $TimeupDateControl
	 * property-read QLabel $TimeupDateLabel
	 * property QTextBox $SuspendedControl
	 * property-read QLabel $SuspendedLabel
	 * property QTextBox $PresentControl
	 * property-read QLabel $PresentLabel
	 * property QTextBox $TimeupControl
	 * property-read QLabel $TimeupLabel
	 * property QTextBox $ActiveControl
	 * property-read QLabel $ActiveLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableUserItemMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableUserItem;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableUserItem's individual data fields
		protected $lblId;
		protected $lstUser;
		protected $txtPresentUserId;
		protected $txtItemId;
		protected $txtPrice;
		protected $txtTaxWithin;
		protected $txtCount;
		protected $txtPresentStatus;
		protected $txtLicenseDay;
		protected $txtSubscription;
		protected $txtImage;
		protected $txtSimage;
		protected $calGetDate;
		protected $calSuspendDate;
		protected $calPresentDate;
		protected $calTimeupDate;
		protected $txtSuspended;
		protected $txtPresent;
		protected $txtTimeup;
		protected $txtActive;

		// Controls that allow the viewing of TableUserItem's individual data fields
		protected $lblUserId;
		protected $lblPresentUserId;
		protected $lblItemId;
		protected $lblPrice;
		protected $lblTaxWithin;
		protected $lblCount;
		protected $lblPresentStatus;
		protected $lblLicenseDay;
		protected $lblSubscription;
		protected $lblImage;
		protected $lblSimage;
		protected $lblGetDate;
		protected $lblSuspendDate;
		protected $lblPresentDate;
		protected $lblTimeupDate;
		protected $lblSuspended;
		protected $lblPresent;
		protected $lblTimeup;
		protected $lblActive;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableUserItemMetaControl to edit a single TableUserItem object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableUserItem object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserItemMetaControl
		 * @param TableUserItem $objTableUserItem new or existing TableUserItem object
		 */
		 public function __construct($objParentObject, TableUserItem $objTableUserItem) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableUserItemMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableUserItem object
			$this->objTableUserItem = $objTableUserItem;

			// Figure out if we're Editing or Creating New
			if ($this->objTableUserItem->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserItemMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableUserItem object creation - defaults to CreateOrEdit
 		 * @return TableUserItemMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableUserItem = TableUserItem::Load($intId);

				// TableUserItem was found -- return it!
				if ($objTableUserItem)
					return new TableUserItemMetaControl($objParentObject, $objTableUserItem);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableUserItem object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableUserItemMetaControl($objParentObject, new TableUserItem());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserItemMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableUserItem object creation - defaults to CreateOrEdit
		 * @return TableUserItemMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableUserItemMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserItemMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableUserItem object creation - defaults to CreateOrEdit
		 * @return TableUserItemMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableUserItemMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableUserItem->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUser
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUser_Create($strControlId = null) {
			$this->lstUser = new QListBox($this->objParentObject, $strControlId);
			$this->lstUser->Name = QApplication::Translate('User');
			$this->lstUser->Required = true;
			if (!$this->blnEditMode)
				$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserArray = TableUserProject::LoadAll();
			if ($objUserArray) foreach ($objUserArray as $objUser) {
				$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
				if (($this->objTableUserItem->User) && ($this->objTableUserItem->User->Id == $objUser->Id))
					$objListItem->Selected = true;
				$this->lstUser->AddItem($objListItem);
			}
			return $this->lstUser;
		}

		/**
		 * Create and setup QLabel lblUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserId_Create($strControlId = null) {
			$this->lblUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserId->Name = QApplication::Translate('User');
			$this->lblUserId->Text = ($this->objTableUserItem->User) ? $this->objTableUserItem->User->__toString() : null;
			$this->lblUserId->Required = true;
			return $this->lblUserId;
		}

		/**
		 * Create and setup QIntegerTextBox txtPresentUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtPresentUserId_Create($strControlId = null) {
			$this->txtPresentUserId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtPresentUserId->Name = QApplication::Translate('Present User Id');
			$this->txtPresentUserId->Text = $this->objTableUserItem->PresentUserId;
			return $this->txtPresentUserId;
		}

		/**
		 * Create and setup QLabel lblPresentUserId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblPresentUserId_Create($strControlId = null, $strFormat = null) {
			$this->lblPresentUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblPresentUserId->Name = QApplication::Translate('Present User Id');
			$this->lblPresentUserId->Text = $this->objTableUserItem->PresentUserId;
			$this->lblPresentUserId->Format = $strFormat;
			return $this->lblPresentUserId;
		}

		/**
		 * Create and setup QIntegerTextBox txtItemId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtItemId_Create($strControlId = null) {
			$this->txtItemId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtItemId->Name = QApplication::Translate('Item Id');
			$this->txtItemId->Text = $this->objTableUserItem->ItemId;
			$this->txtItemId->Required = true;
			return $this->txtItemId;
		}

		/**
		 * Create and setup QLabel lblItemId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblItemId_Create($strControlId = null, $strFormat = null) {
			$this->lblItemId = new QLabel($this->objParentObject, $strControlId);
			$this->lblItemId->Name = QApplication::Translate('Item Id');
			$this->lblItemId->Text = $this->objTableUserItem->ItemId;
			$this->lblItemId->Required = true;
			$this->lblItemId->Format = $strFormat;
			return $this->lblItemId;
		}

		/**
		 * Create and setup QIntegerTextBox txtPrice
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtPrice_Create($strControlId = null) {
			$this->txtPrice = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtPrice->Name = QApplication::Translate('Price');
			$this->txtPrice->Text = $this->objTableUserItem->Price;
			$this->txtPrice->Required = true;
			return $this->txtPrice;
		}

		/**
		 * Create and setup QLabel lblPrice
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblPrice_Create($strControlId = null, $strFormat = null) {
			$this->lblPrice = new QLabel($this->objParentObject, $strControlId);
			$this->lblPrice->Name = QApplication::Translate('Price');
			$this->lblPrice->Text = $this->objTableUserItem->Price;
			$this->lblPrice->Required = true;
			$this->lblPrice->Format = $strFormat;
			return $this->lblPrice;
		}

		/**
		 * Create and setup QIntegerTextBox txtTaxWithin
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtTaxWithin_Create($strControlId = null) {
			$this->txtTaxWithin = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtTaxWithin->Name = QApplication::Translate('Tax Within');
			$this->txtTaxWithin->Text = $this->objTableUserItem->TaxWithin;
			return $this->txtTaxWithin;
		}

		/**
		 * Create and setup QLabel lblTaxWithin
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblTaxWithin_Create($strControlId = null, $strFormat = null) {
			$this->lblTaxWithin = new QLabel($this->objParentObject, $strControlId);
			$this->lblTaxWithin->Name = QApplication::Translate('Tax Within');
			$this->lblTaxWithin->Text = $this->objTableUserItem->TaxWithin;
			$this->lblTaxWithin->Format = $strFormat;
			return $this->lblTaxWithin;
		}

		/**
		 * Create and setup QIntegerTextBox txtCount
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtCount_Create($strControlId = null) {
			$this->txtCount = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtCount->Name = QApplication::Translate('Count');
			$this->txtCount->Text = $this->objTableUserItem->Count;
			return $this->txtCount;
		}

		/**
		 * Create and setup QLabel lblCount
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblCount_Create($strControlId = null, $strFormat = null) {
			$this->lblCount = new QLabel($this->objParentObject, $strControlId);
			$this->lblCount->Name = QApplication::Translate('Count');
			$this->lblCount->Text = $this->objTableUserItem->Count;
			$this->lblCount->Format = $strFormat;
			return $this->lblCount;
		}

		/**
		 * Create and setup QIntegerTextBox txtPresentStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtPresentStatus_Create($strControlId = null) {
			$this->txtPresentStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtPresentStatus->Name = QApplication::Translate('Present Status');
			$this->txtPresentStatus->Text = $this->objTableUserItem->PresentStatus;
			return $this->txtPresentStatus;
		}

		/**
		 * Create and setup QLabel lblPresentStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblPresentStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblPresentStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblPresentStatus->Name = QApplication::Translate('Present Status');
			$this->lblPresentStatus->Text = $this->objTableUserItem->PresentStatus;
			$this->lblPresentStatus->Format = $strFormat;
			return $this->lblPresentStatus;
		}

		/**
		 * Create and setup QIntegerTextBox txtLicenseDay
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtLicenseDay_Create($strControlId = null) {
			$this->txtLicenseDay = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtLicenseDay->Name = QApplication::Translate('License Day');
			$this->txtLicenseDay->Text = $this->objTableUserItem->LicenseDay;
			return $this->txtLicenseDay;
		}

		/**
		 * Create and setup QLabel lblLicenseDay
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblLicenseDay_Create($strControlId = null, $strFormat = null) {
			$this->lblLicenseDay = new QLabel($this->objParentObject, $strControlId);
			$this->lblLicenseDay->Name = QApplication::Translate('License Day');
			$this->lblLicenseDay->Text = $this->objTableUserItem->LicenseDay;
			$this->lblLicenseDay->Format = $strFormat;
			return $this->lblLicenseDay;
		}

		/**
		 * Create and setup QTextBox txtSubscription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSubscription_Create($strControlId = null) {
			$this->txtSubscription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSubscription->Name = QApplication::Translate('Subscription');
			$this->txtSubscription->Text = $this->objTableUserItem->Subscription;
			$this->txtSubscription->MaxLength = TableUserItem::SubscriptionMaxLength;
			return $this->txtSubscription;
		}

		/**
		 * Create and setup QLabel lblSubscription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSubscription_Create($strControlId = null) {
			$this->lblSubscription = new QLabel($this->objParentObject, $strControlId);
			$this->lblSubscription->Name = QApplication::Translate('Subscription');
			$this->lblSubscription->Text = $this->objTableUserItem->Subscription;
			return $this->lblSubscription;
		}

		/**
		 * Create and setup QTextBox txtImage
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtImage_Create($strControlId = null) {
			$this->txtImage = new QTextBox($this->objParentObject, $strControlId);
			$this->txtImage->Name = QApplication::Translate('Image');
			$this->txtImage->Text = $this->objTableUserItem->Image;
			$this->txtImage->TextMode = QTextMode::MultiLine;
			return $this->txtImage;
		}

		/**
		 * Create and setup QLabel lblImage
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblImage_Create($strControlId = null) {
			$this->lblImage = new QLabel($this->objParentObject, $strControlId);
			$this->lblImage->Name = QApplication::Translate('Image');
			$this->lblImage->Text = $this->objTableUserItem->Image;
			return $this->lblImage;
		}

		/**
		 * Create and setup QTextBox txtSimage
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSimage_Create($strControlId = null) {
			$this->txtSimage = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSimage->Name = QApplication::Translate('Simage');
			$this->txtSimage->Text = $this->objTableUserItem->Simage;
			$this->txtSimage->TextMode = QTextMode::MultiLine;
			return $this->txtSimage;
		}

		/**
		 * Create and setup QLabel lblSimage
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSimage_Create($strControlId = null) {
			$this->lblSimage = new QLabel($this->objParentObject, $strControlId);
			$this->lblSimage->Name = QApplication::Translate('Simage');
			$this->lblSimage->Text = $this->objTableUserItem->Simage;
			return $this->lblSimage;
		}

		/**
		 * Create and setup QDateTimePicker calGetDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calGetDate_Create($strControlId = null) {
			$this->calGetDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calGetDate->Name = QApplication::Translate('Get Date');
			$this->calGetDate->DateTime = $this->objTableUserItem->GetDate;
			$this->calGetDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calGetDate;
		}

		/**
		 * Create and setup QLabel lblGetDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblGetDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblGetDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblGetDate->Name = QApplication::Translate('Get Date');
			$this->strGetDateDateTimeFormat = $strDateTimeFormat;
			$this->lblGetDate->Text = sprintf($this->objTableUserItem->GetDate) ? $this->objTableUserItem->GetDate->__toString($this->strGetDateDateTimeFormat) : null;
			return $this->lblGetDate;
		}

		protected $strGetDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calSuspendDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calSuspendDate_Create($strControlId = null) {
			$this->calSuspendDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calSuspendDate->Name = QApplication::Translate('Suspend Date');
			$this->calSuspendDate->DateTime = $this->objTableUserItem->SuspendDate;
			$this->calSuspendDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calSuspendDate;
		}

		/**
		 * Create and setup QLabel lblSuspendDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblSuspendDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblSuspendDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblSuspendDate->Name = QApplication::Translate('Suspend Date');
			$this->strSuspendDateDateTimeFormat = $strDateTimeFormat;
			$this->lblSuspendDate->Text = sprintf($this->objTableUserItem->SuspendDate) ? $this->objTableUserItem->SuspendDate->__toString($this->strSuspendDateDateTimeFormat) : null;
			return $this->lblSuspendDate;
		}

		protected $strSuspendDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calPresentDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calPresentDate_Create($strControlId = null) {
			$this->calPresentDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calPresentDate->Name = QApplication::Translate('Present Date');
			$this->calPresentDate->DateTime = $this->objTableUserItem->PresentDate;
			$this->calPresentDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calPresentDate;
		}

		/**
		 * Create and setup QLabel lblPresentDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblPresentDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblPresentDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblPresentDate->Name = QApplication::Translate('Present Date');
			$this->strPresentDateDateTimeFormat = $strDateTimeFormat;
			$this->lblPresentDate->Text = sprintf($this->objTableUserItem->PresentDate) ? $this->objTableUserItem->PresentDate->__toString($this->strPresentDateDateTimeFormat) : null;
			return $this->lblPresentDate;
		}

		protected $strPresentDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calTimeupDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calTimeupDate_Create($strControlId = null) {
			$this->calTimeupDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calTimeupDate->Name = QApplication::Translate('Timeup Date');
			$this->calTimeupDate->DateTime = $this->objTableUserItem->TimeupDate;
			$this->calTimeupDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calTimeupDate;
		}

		/**
		 * Create and setup QLabel lblTimeupDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblTimeupDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblTimeupDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblTimeupDate->Name = QApplication::Translate('Timeup Date');
			$this->strTimeupDateDateTimeFormat = $strDateTimeFormat;
			$this->lblTimeupDate->Text = sprintf($this->objTableUserItem->TimeupDate) ? $this->objTableUserItem->TimeupDate->__toString($this->strTimeupDateDateTimeFormat) : null;
			return $this->lblTimeupDate;
		}

		protected $strTimeupDateDateTimeFormat;


		/**
		 * Create and setup QTextBox txtSuspended
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSuspended_Create($strControlId = null) {
			$this->txtSuspended = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSuspended->Name = QApplication::Translate('Suspended');
			$this->txtSuspended->Text = $this->objTableUserItem->Suspended;
			$this->txtSuspended->Required = true;
			$this->txtSuspended->MaxLength = TableUserItem::SuspendedMaxLength;
			return $this->txtSuspended;
		}

		/**
		 * Create and setup QLabel lblSuspended
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSuspended_Create($strControlId = null) {
			$this->lblSuspended = new QLabel($this->objParentObject, $strControlId);
			$this->lblSuspended->Name = QApplication::Translate('Suspended');
			$this->lblSuspended->Text = $this->objTableUserItem->Suspended;
			$this->lblSuspended->Required = true;
			return $this->lblSuspended;
		}

		/**
		 * Create and setup QTextBox txtPresent
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtPresent_Create($strControlId = null) {
			$this->txtPresent = new QTextBox($this->objParentObject, $strControlId);
			$this->txtPresent->Name = QApplication::Translate('Present');
			$this->txtPresent->Text = $this->objTableUserItem->Present;
			$this->txtPresent->Required = true;
			$this->txtPresent->MaxLength = TableUserItem::PresentMaxLength;
			return $this->txtPresent;
		}

		/**
		 * Create and setup QLabel lblPresent
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblPresent_Create($strControlId = null) {
			$this->lblPresent = new QLabel($this->objParentObject, $strControlId);
			$this->lblPresent->Name = QApplication::Translate('Present');
			$this->lblPresent->Text = $this->objTableUserItem->Present;
			$this->lblPresent->Required = true;
			return $this->lblPresent;
		}

		/**
		 * Create and setup QTextBox txtTimeup
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtTimeup_Create($strControlId = null) {
			$this->txtTimeup = new QTextBox($this->objParentObject, $strControlId);
			$this->txtTimeup->Name = QApplication::Translate('Timeup');
			$this->txtTimeup->Text = $this->objTableUserItem->Timeup;
			$this->txtTimeup->Required = true;
			$this->txtTimeup->MaxLength = TableUserItem::TimeupMaxLength;
			return $this->txtTimeup;
		}

		/**
		 * Create and setup QLabel lblTimeup
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblTimeup_Create($strControlId = null) {
			$this->lblTimeup = new QLabel($this->objParentObject, $strControlId);
			$this->lblTimeup->Name = QApplication::Translate('Timeup');
			$this->lblTimeup->Text = $this->objTableUserItem->Timeup;
			$this->lblTimeup->Required = true;
			return $this->lblTimeup;
		}

		/**
		 * Create and setup QTextBox txtActive
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActive_Create($strControlId = null) {
			$this->txtActive = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActive->Name = QApplication::Translate('Active');
			$this->txtActive->Text = $this->objTableUserItem->Active;
			$this->txtActive->Required = true;
			$this->txtActive->MaxLength = TableUserItem::ActiveMaxLength;
			return $this->txtActive;
		}

		/**
		 * Create and setup QLabel lblActive
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActive_Create($strControlId = null) {
			$this->lblActive = new QLabel($this->objParentObject, $strControlId);
			$this->lblActive->Name = QApplication::Translate('Active');
			$this->lblActive->Text = $this->objTableUserItem->Active;
			$this->lblActive->Required = true;
			return $this->lblActive;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableUserItem object.
		 * @param boolean $blnReload reload TableUserItem from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableUserItem->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableUserItem->Id;

			if ($this->lstUser) {
					$this->lstUser->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserArray = TableUserProject::LoadAll();
				if ($objUserArray) foreach ($objUserArray as $objUser) {
					$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
					if (($this->objTableUserItem->User) && ($this->objTableUserItem->User->Id == $objUser->Id))
						$objListItem->Selected = true;
					$this->lstUser->AddItem($objListItem);
				}
			}
			if ($this->lblUserId) $this->lblUserId->Text = ($this->objTableUserItem->User) ? $this->objTableUserItem->User->__toString() : null;

			if ($this->txtPresentUserId) $this->txtPresentUserId->Text = $this->objTableUserItem->PresentUserId;
			if ($this->lblPresentUserId) $this->lblPresentUserId->Text = $this->objTableUserItem->PresentUserId;

			if ($this->txtItemId) $this->txtItemId->Text = $this->objTableUserItem->ItemId;
			if ($this->lblItemId) $this->lblItemId->Text = $this->objTableUserItem->ItemId;

			if ($this->txtPrice) $this->txtPrice->Text = $this->objTableUserItem->Price;
			if ($this->lblPrice) $this->lblPrice->Text = $this->objTableUserItem->Price;

			if ($this->txtTaxWithin) $this->txtTaxWithin->Text = $this->objTableUserItem->TaxWithin;
			if ($this->lblTaxWithin) $this->lblTaxWithin->Text = $this->objTableUserItem->TaxWithin;

			if ($this->txtCount) $this->txtCount->Text = $this->objTableUserItem->Count;
			if ($this->lblCount) $this->lblCount->Text = $this->objTableUserItem->Count;

			if ($this->txtPresentStatus) $this->txtPresentStatus->Text = $this->objTableUserItem->PresentStatus;
			if ($this->lblPresentStatus) $this->lblPresentStatus->Text = $this->objTableUserItem->PresentStatus;

			if ($this->txtLicenseDay) $this->txtLicenseDay->Text = $this->objTableUserItem->LicenseDay;
			if ($this->lblLicenseDay) $this->lblLicenseDay->Text = $this->objTableUserItem->LicenseDay;

			if ($this->txtSubscription) $this->txtSubscription->Text = $this->objTableUserItem->Subscription;
			if ($this->lblSubscription) $this->lblSubscription->Text = $this->objTableUserItem->Subscription;

			if ($this->txtImage) $this->txtImage->Text = $this->objTableUserItem->Image;
			if ($this->lblImage) $this->lblImage->Text = $this->objTableUserItem->Image;

			if ($this->txtSimage) $this->txtSimage->Text = $this->objTableUserItem->Simage;
			if ($this->lblSimage) $this->lblSimage->Text = $this->objTableUserItem->Simage;

			if ($this->calGetDate) $this->calGetDate->DateTime = $this->objTableUserItem->GetDate;
			if ($this->lblGetDate) $this->lblGetDate->Text = sprintf($this->objTableUserItem->GetDate) ? $this->objTableUserItem->GetDate->__toString($this->strGetDateDateTimeFormat) : null;

			if ($this->calSuspendDate) $this->calSuspendDate->DateTime = $this->objTableUserItem->SuspendDate;
			if ($this->lblSuspendDate) $this->lblSuspendDate->Text = sprintf($this->objTableUserItem->SuspendDate) ? $this->objTableUserItem->SuspendDate->__toString($this->strSuspendDateDateTimeFormat) : null;

			if ($this->calPresentDate) $this->calPresentDate->DateTime = $this->objTableUserItem->PresentDate;
			if ($this->lblPresentDate) $this->lblPresentDate->Text = sprintf($this->objTableUserItem->PresentDate) ? $this->objTableUserItem->PresentDate->__toString($this->strPresentDateDateTimeFormat) : null;

			if ($this->calTimeupDate) $this->calTimeupDate->DateTime = $this->objTableUserItem->TimeupDate;
			if ($this->lblTimeupDate) $this->lblTimeupDate->Text = sprintf($this->objTableUserItem->TimeupDate) ? $this->objTableUserItem->TimeupDate->__toString($this->strTimeupDateDateTimeFormat) : null;

			if ($this->txtSuspended) $this->txtSuspended->Text = $this->objTableUserItem->Suspended;
			if ($this->lblSuspended) $this->lblSuspended->Text = $this->objTableUserItem->Suspended;

			if ($this->txtPresent) $this->txtPresent->Text = $this->objTableUserItem->Present;
			if ($this->lblPresent) $this->lblPresent->Text = $this->objTableUserItem->Present;

			if ($this->txtTimeup) $this->txtTimeup->Text = $this->objTableUserItem->Timeup;
			if ($this->lblTimeup) $this->lblTimeup->Text = $this->objTableUserItem->Timeup;

			if ($this->txtActive) $this->txtActive->Text = $this->objTableUserItem->Active;
			if ($this->lblActive) $this->lblActive->Text = $this->objTableUserItem->Active;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEUSERITEM OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableUserItem instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableUserItem() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUser) $this->objTableUserItem->UserId = $this->lstUser->SelectedValue;
				if ($this->txtPresentUserId) $this->objTableUserItem->PresentUserId = $this->txtPresentUserId->Text;
				if ($this->txtItemId) $this->objTableUserItem->ItemId = $this->txtItemId->Text;
				if ($this->txtPrice) $this->objTableUserItem->Price = $this->txtPrice->Text;
				if ($this->txtTaxWithin) $this->objTableUserItem->TaxWithin = $this->txtTaxWithin->Text;
				if ($this->txtCount) $this->objTableUserItem->Count = $this->txtCount->Text;
				if ($this->txtPresentStatus) $this->objTableUserItem->PresentStatus = $this->txtPresentStatus->Text;
				if ($this->txtLicenseDay) $this->objTableUserItem->LicenseDay = $this->txtLicenseDay->Text;
				if ($this->txtSubscription) $this->objTableUserItem->Subscription = $this->txtSubscription->Text;
				if ($this->txtImage) $this->objTableUserItem->Image = $this->txtImage->Text;
				if ($this->txtSimage) $this->objTableUserItem->Simage = $this->txtSimage->Text;
				if ($this->calGetDate) $this->objTableUserItem->GetDate = $this->calGetDate->DateTime;
				if ($this->calSuspendDate) $this->objTableUserItem->SuspendDate = $this->calSuspendDate->DateTime;
				if ($this->calPresentDate) $this->objTableUserItem->PresentDate = $this->calPresentDate->DateTime;
				if ($this->calTimeupDate) $this->objTableUserItem->TimeupDate = $this->calTimeupDate->DateTime;
				if ($this->txtSuspended) $this->objTableUserItem->Suspended = $this->txtSuspended->Text;
				if ($this->txtPresent) $this->objTableUserItem->Present = $this->txtPresent->Text;
				if ($this->txtTimeup) $this->objTableUserItem->Timeup = $this->txtTimeup->Text;
				if ($this->txtActive) $this->objTableUserItem->Active = $this->txtActive->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableUserItem object
				$this->objTableUserItem->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableUserItem instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableUserItem() {
			$this->objTableUserItem->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableUserItem': return $this->objTableUserItem;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableUserItem fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdControl':
					if (!$this->lstUser) return $this->lstUser_Create();
					return $this->lstUser;
				case 'UserIdLabel':
					if (!$this->lblUserId) return $this->lblUserId_Create();
					return $this->lblUserId;
				case 'PresentUserIdControl':
					if (!$this->txtPresentUserId) return $this->txtPresentUserId_Create();
					return $this->txtPresentUserId;
				case 'PresentUserIdLabel':
					if (!$this->lblPresentUserId) return $this->lblPresentUserId_Create();
					return $this->lblPresentUserId;
				case 'ItemIdControl':
					if (!$this->txtItemId) return $this->txtItemId_Create();
					return $this->txtItemId;
				case 'ItemIdLabel':
					if (!$this->lblItemId) return $this->lblItemId_Create();
					return $this->lblItemId;
				case 'PriceControl':
					if (!$this->txtPrice) return $this->txtPrice_Create();
					return $this->txtPrice;
				case 'PriceLabel':
					if (!$this->lblPrice) return $this->lblPrice_Create();
					return $this->lblPrice;
				case 'TaxWithinControl':
					if (!$this->txtTaxWithin) return $this->txtTaxWithin_Create();
					return $this->txtTaxWithin;
				case 'TaxWithinLabel':
					if (!$this->lblTaxWithin) return $this->lblTaxWithin_Create();
					return $this->lblTaxWithin;
				case 'CountControl':
					if (!$this->txtCount) return $this->txtCount_Create();
					return $this->txtCount;
				case 'CountLabel':
					if (!$this->lblCount) return $this->lblCount_Create();
					return $this->lblCount;
				case 'PresentStatusControl':
					if (!$this->txtPresentStatus) return $this->txtPresentStatus_Create();
					return $this->txtPresentStatus;
				case 'PresentStatusLabel':
					if (!$this->lblPresentStatus) return $this->lblPresentStatus_Create();
					return $this->lblPresentStatus;
				case 'LicenseDayControl':
					if (!$this->txtLicenseDay) return $this->txtLicenseDay_Create();
					return $this->txtLicenseDay;
				case 'LicenseDayLabel':
					if (!$this->lblLicenseDay) return $this->lblLicenseDay_Create();
					return $this->lblLicenseDay;
				case 'SubscriptionControl':
					if (!$this->txtSubscription) return $this->txtSubscription_Create();
					return $this->txtSubscription;
				case 'SubscriptionLabel':
					if (!$this->lblSubscription) return $this->lblSubscription_Create();
					return $this->lblSubscription;
				case 'ImageControl':
					if (!$this->txtImage) return $this->txtImage_Create();
					return $this->txtImage;
				case 'ImageLabel':
					if (!$this->lblImage) return $this->lblImage_Create();
					return $this->lblImage;
				case 'SimageControl':
					if (!$this->txtSimage) return $this->txtSimage_Create();
					return $this->txtSimage;
				case 'SimageLabel':
					if (!$this->lblSimage) return $this->lblSimage_Create();
					return $this->lblSimage;
				case 'GetDateControl':
					if (!$this->calGetDate) return $this->calGetDate_Create();
					return $this->calGetDate;
				case 'GetDateLabel':
					if (!$this->lblGetDate) return $this->lblGetDate_Create();
					return $this->lblGetDate;
				case 'SuspendDateControl':
					if (!$this->calSuspendDate) return $this->calSuspendDate_Create();
					return $this->calSuspendDate;
				case 'SuspendDateLabel':
					if (!$this->lblSuspendDate) return $this->lblSuspendDate_Create();
					return $this->lblSuspendDate;
				case 'PresentDateControl':
					if (!$this->calPresentDate) return $this->calPresentDate_Create();
					return $this->calPresentDate;
				case 'PresentDateLabel':
					if (!$this->lblPresentDate) return $this->lblPresentDate_Create();
					return $this->lblPresentDate;
				case 'TimeupDateControl':
					if (!$this->calTimeupDate) return $this->calTimeupDate_Create();
					return $this->calTimeupDate;
				case 'TimeupDateLabel':
					if (!$this->lblTimeupDate) return $this->lblTimeupDate_Create();
					return $this->lblTimeupDate;
				case 'SuspendedControl':
					if (!$this->txtSuspended) return $this->txtSuspended_Create();
					return $this->txtSuspended;
				case 'SuspendedLabel':
					if (!$this->lblSuspended) return $this->lblSuspended_Create();
					return $this->lblSuspended;
				case 'PresentControl':
					if (!$this->txtPresent) return $this->txtPresent_Create();
					return $this->txtPresent;
				case 'PresentLabel':
					if (!$this->lblPresent) return $this->lblPresent_Create();
					return $this->lblPresent;
				case 'TimeupControl':
					if (!$this->txtTimeup) return $this->txtTimeup_Create();
					return $this->txtTimeup;
				case 'TimeupLabel':
					if (!$this->lblTimeup) return $this->lblTimeup_Create();
					return $this->lblTimeup;
				case 'ActiveControl':
					if (!$this->txtActive) return $this->txtActive_Create();
					return $this->txtActive;
				case 'ActiveLabel':
					if (!$this->lblActive) return $this->lblActive_Create();
					return $this->lblActive;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableUserItem fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdControl':
						return ($this->lstUser = QType::Cast($mixValue, 'QControl'));
					case 'PresentUserIdControl':
						return ($this->txtPresentUserId = QType::Cast($mixValue, 'QControl'));
					case 'ItemIdControl':
						return ($this->txtItemId = QType::Cast($mixValue, 'QControl'));
					case 'PriceControl':
						return ($this->txtPrice = QType::Cast($mixValue, 'QControl'));
					case 'TaxWithinControl':
						return ($this->txtTaxWithin = QType::Cast($mixValue, 'QControl'));
					case 'CountControl':
						return ($this->txtCount = QType::Cast($mixValue, 'QControl'));
					case 'PresentStatusControl':
						return ($this->txtPresentStatus = QType::Cast($mixValue, 'QControl'));
					case 'LicenseDayControl':
						return ($this->txtLicenseDay = QType::Cast($mixValue, 'QControl'));
					case 'SubscriptionControl':
						return ($this->txtSubscription = QType::Cast($mixValue, 'QControl'));
					case 'ImageControl':
						return ($this->txtImage = QType::Cast($mixValue, 'QControl'));
					case 'SimageControl':
						return ($this->txtSimage = QType::Cast($mixValue, 'QControl'));
					case 'GetDateControl':
						return ($this->calGetDate = QType::Cast($mixValue, 'QControl'));
					case 'SuspendDateControl':
						return ($this->calSuspendDate = QType::Cast($mixValue, 'QControl'));
					case 'PresentDateControl':
						return ($this->calPresentDate = QType::Cast($mixValue, 'QControl'));
					case 'TimeupDateControl':
						return ($this->calTimeupDate = QType::Cast($mixValue, 'QControl'));
					case 'SuspendedControl':
						return ($this->txtSuspended = QType::Cast($mixValue, 'QControl'));
					case 'PresentControl':
						return ($this->txtPresent = QType::Cast($mixValue, 'QControl'));
					case 'TimeupControl':
						return ($this->txtTimeup = QType::Cast($mixValue, 'QControl'));
					case 'ActiveControl':
						return ($this->txtActive = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>